#ifndef PAYMENTPAGE_H
#define PAYMENTPAGE_H

#include <QWidget>
#include <QTcpSocket>
#include <QJsonObject>
#include <QDebug>
#include <QTableWidget>
#include <QPushButton>
#include <QVBoxLayout>
namespace Ui {
class PaymentPage;
}

class PaymentPage : public QWidget
{
    Q_OBJECT

public:
    explicit PaymentPage(QWidget *parent = nullptr,QTcpSocket* externalSocket = nullptr);
    ~PaymentPage();
    void onRefreshClicked();
    void onExportClicked();
    void loadPaymentRecordsFromFile();
public slots:
    void handleServerMessage(const QJsonObject& json);
private:
    Ui::PaymentPage *ui;
    QTcpSocket* socket;
    QTableWidget *tableWidget;
    QPushButton *refreshButton;
    QPushButton *exportButton;
    QVBoxLayout *mainLayout;
};

#endif // PAYMENTPAGE_H
